package com.lesama.array;

public class ArrayDemo2 {
    public static void main(String[] args) {
        printArr();
        getEvenSum();
    }
    public static void printArr() {
        int[] arr = {1, 2, 3, 4, 5, 6, 7};
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
    }
    public static void getEvenSum() {
        int[] arr = {1, 2, 3, 4, 5, 78, 9, 5, 6, 45, 14};
        int evenSum = 0;
        for (int i = 0; i < arr.length; i++) {
            if(arr[i] % 2 == 0) {
                evenSum += arr[i];
            }
        }
        System.out.println(evenSum);
    }
}
